﻿//===================================================================================
// Copyright (c) Ryan Garrett.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===================================================================================

//WRITE: Calling GetMetadata will NOT give you a metadata object that is completely segregated from its source. You have to perform a deep copy on it
//       for the entire object graph to be using different instances

using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

/*
 public ModelBase Parent

 public ModelPropertyBase ParentProperty
 
 public IPropertyChangeCounter PropertyChangeCounter
 
 public IEnumerable<ModelPropertyBase> Properties
 
 public IEnumerable<ModelCommandBase> Commands
 */

namespace Caffeine.Core.Metadata
{
    [DataContract]
    public sealed class ModelMetadata
    {
        [DataMember]
        public String FullyQualifiedTypeName
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsDirty
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsDirtyWithin
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsInvalid
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsInvalidWithin
        {
            get;
            set;
        }

        [DataMember]
        public Boolean HasParent
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsRemovedFromParent
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsAddedToCollection
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsCommittedToCollection
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsRemovedFromCollection
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsAssignedToParentProperty
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsCommittedToParentProperty
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsRemovedFromParentProperty
        {
            get;
            set;
        }

        [DataMember]
        public Int32 DirtyPropertyCount
        {
            get;
            set;
        }

        [DataMember]
        public Int32 InvalidPropertyCount
        {
            get;
            set;
        }

        [DataMember]
        public String Name
        {
            get;
            set;
        }

        [DataMember]
        public Nullable<Guid> UniqueId
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsParentDirtyWithin
        {
            get;
            set;
        }

        [DataMember]
        public Boolean IsParentInvalidWithin
        {
            get;
            set;
        }

        [DataMember]
        public Int32 DirtyWithinPropertyCount
        {
            get;
            set;
        }

        [DataMember]
        public Int32 InvalidWithinPropertyCount
        {
            get;
            set;
        }

        [DataMember]
        public IDictionary<String, Object> ExtensibleData
        {
            get;
            set;
        }

        [DataMember]
        public ModelScalarPropertyMetadata[] ScalarProperties
        {
            get;
            set;
        }

        [DataMember]
        public ModelCollectionMetadata[] CollectionProperties
        {
            get;
            set;
        }

        [DataMember]
        public ModelCommandMetadata[] Commands
        {
            get;
            set;
        }
    }
}
